package io.ByteStream;

import java.io.*;

// 拷贝
public class IoTest3 {
    public static void main(String[] args) throws IOException {
        // 创建一个字节缓冲输入流
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(""));
        // 创建一个字节缓冲输出流
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(""));

       /* int b;
        while ((b = bis.read())!=-1){
            bos.write(b);
        }*/

       // 数组拷贝
        byte[] bytes = new byte[1024];
        int len;// 本次读取到的有效字节个数
        while ((len = bis.read(bytes)) != -1){
            bos.write(bytes,0,len);
        }

        bis.close();
        bos.close();
    }
}
